import { Route, Routes } from 'react-router-dom';
import { lazy, Suspense } from 'react';

const Home = lazy(async () => await import('@cpt/Home'));
const Error = (): React.ReactElement => <div className="notFound">404</div>;

export default function RouteViews(): React.ReactElement {
  return (
    <>
      <Routes>
        <Route
          path="/"
          element={
            <Suspense>
              <Home></Home>
            </Suspense>
          }
        ></Route>
        <Route path="*" element={<Error></Error>}></Route>
      </Routes>
    </>
  );
}
